<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Gem::RequestSet::GemDependencyAPI - rubygems: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
<div id="sections-section" class="nav-section">
  <h3>Sections</h3>

  <ul class="link-list" role="directory">
      <li><a href="#5Buntitled-5D"></a></li>
      <li><a href="#Gem+Dependencies+DSL">Gem Dependencies DSL</a></li>
  </ul>
</div>

        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-gem">#gem</a>
    <li ><a href="#method-i-gemspec">#gemspec</a>
    <li ><a href="#method-i-git">#git</a>
    <li ><a href="#method-i-git_source">#git_source</a>
    <li ><a href="#method-i-group">#group</a>
    <li ><a href="#method-i-load">#load</a>
    <li ><a href="#method-i-pin_gem_source">#pin_gem_source</a>
    <li ><a href="#method-i-platform">#platform</a>
    <li ><a href="#method-i-platforms">#platforms</a>
    <li ><a href="#method-i-ruby">#ruby</a>
    <li ><a href="#method-i-source">#source</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Gem::RequestSet::GemDependencyAPI">
    <h1 id="class-Gem::RequestSet::GemDependencyAPI" class="class">
      class Gem::RequestSet::GemDependencyAPI
    </h1>

    <section class="description">
    
<p>A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies files.</p>

<p>To work with both the Bundler Gemfile and Isolate formats this implementation takes some liberties to allow compatibility with each, most notably in <a href="GemDependencyAPI.html#method-i-source"><code>source</code></a>.</p>

<p>A basic gem dependencies file will look like the following:</p>

<pre>source &#39;https://rubygems.org&#39;

gem &#39;rails&#39;, &#39;3.2.14a
gem &#39;devise&#39;, &#39;~&gt; 2.1&#39;, &#39;&gt;= 2.1.3&#39;
gem &#39;cancan&#39;
gem &#39;airbrake&#39;
gem &#39;pg&#39;</pre>

<p>RubyGems recommends saving this as gem.deps.rb over Gemfile or Isolate.</p>

<p>To install the gems in this Gemfile use ‘gem install -g` to install it and create a lockfile.  The lockfile will ensure that when you make changes to your gem dependencies file a minimum amount of change is made to the dependencies of your gems.</p>

<p>RubyGems can activate all the gems in your dependencies file at startup using the RUBYGEMS_GEMDEPS environment variable or through <a href="../../Gem.html#method-c-use_gemdeps"><code>Gem.use_gemdeps</code></a>. See <a href="../../Gem.html#method-c-use_gemdeps"><code>Gem.use_gemdeps</code></a> for details and warnings.</p>

<p>See ‘gem help install` and `gem help gem_dependencies` for further details.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-dependencies" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">dependencies</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The gems required by <a href="GemDependencyAPI.html#method-i-gem"><code>gem</code></a> statements in the gem.deps.rb file</p>
              </div>
            </div>
          <div id="attribute-i-requires" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">requires</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>A Hash containing gem names and files to require from those gems.</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(set, path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new <a href="GemDependencyAPI.html"><code>GemDependencyAPI</code></a> that will add dependencies to the <a href="../RequestSet.html"><code>Gem::RequestSet</code></a> <code>set</code> based on the dependency API description in <code>path</code>.</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 197</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">set</span>, <span class="ruby-identifier">path</span>)
  <span class="ruby-ivar">@set</span> = <span class="ruby-identifier">set</span>
  <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>

  <span class="ruby-ivar">@current_groups</span>     = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@current_platforms</span>  = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@current_repository</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@dependencies</span>       = {}
  <span class="ruby-ivar">@default_sources</span>    = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@git_set</span>            = <span class="ruby-ivar">@set</span>.<span class="ruby-identifier">git_set</span>
  <span class="ruby-ivar">@git_sources</span>        = {}
  <span class="ruby-ivar">@installing</span>         = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@requires</span>           = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">name</span>] = [] }
  <span class="ruby-ivar">@vendor_set</span>         = <span class="ruby-ivar">@set</span>.<span class="ruby-identifier">vendor_set</span>
  <span class="ruby-ivar">@source_set</span>         = <span class="ruby-ivar">@set</span>.<span class="ruby-identifier">source_set</span>
  <span class="ruby-ivar">@gem_sources</span>        = {}
  <span class="ruby-ivar">@without_groups</span>     = []

  <span class="ruby-identifier">git_source</span> <span class="ruby-value">:github</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">repo_name</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">repo_name</span> = <span class="ruby-node">&quot;#{repo_name}/#{repo_name}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">repo_name</span>.<span class="ruby-identifier">include?</span> <span class="ruby-string">&quot;/&quot;</span>

    <span class="ruby-node">&quot;https://github.com/#{repo_name}.git&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">git_source</span> <span class="ruby-value">:bitbucket</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">repo_name</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">repo_name</span> = <span class="ruby-node">&quot;#{repo_name}/#{repo_name}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">repo_name</span>.<span class="ruby-identifier">include?</span> <span class="ruby-string">&quot;/&quot;</span>

    <span class="ruby-identifier">user</span>, = <span class="ruby-identifier">repo_name</span>.<span class="ruby-identifier">split</span> <span class="ruby-string">&quot;/&quot;</span>, <span class="ruby-value">2</span>

    <span class="ruby-node">&quot;https://#{user}@bitbucket.org/#{repo_name}.git&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-git_source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">git_source</span><span
                                class="method-args">(name, &amp;callback)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Defines a custom git source that uses <code>name</code> to expand git repositories for use in gems built from git repositories.  You must provide a block that accepts a git repository name for expansion.</p>

                              <div class="method-source-code" id="git_source-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 605</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">git_source</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">callback</span>)
  <span class="ruby-ivar">@git_sources</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">callback</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Loads the gem dependency file and returns self.</p>

                              <div class="method-source-code" id="load-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 282</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
  <span class="ruby-identifier">instance_eval</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@path</span>).<span class="ruby-identifier">tap</span>(<span class="ruby-operator">&amp;</span><span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">UNTAINT</span>), <span class="ruby-ivar">@path</span>, <span class="ruby-value">1</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-pin_gem_source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pin_gem_source</span><span
                                class="method-args">(name, type = :default, source = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Pins the gem <code>name</code> to the given <code>source</code>.  Adding a gem with the same name from a different <code>source</code> will raise an exception.</p>

                              <div class="method-source-code" id="pin_gem_source-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 695</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pin_gem_source</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span> = <span class="ruby-value">:default</span>, <span class="ruby-identifier">source</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">source_description</span> =
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:default</span> <span class="ruby-keyword">then</span> <span class="ruby-string">&quot;(default)&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:path</span>    <span class="ruby-keyword">then</span> <span class="ruby-node">&quot;path: #{source}&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:git</span>     <span class="ruby-keyword">then</span> <span class="ruby-node">&quot;git: #{source}&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:source</span>  <span class="ruby-keyword">then</span> <span class="ruby-node">&quot;source: #{source}&quot;</span>
    <span class="ruby-keyword">else</span>               <span class="ruby-string">&quot;(unknown)&quot;</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
    <span class="ruby-node">&quot;duplicate source #{source_description} for gem #{name}&quot;</span> <span class="ruby-keyword">if</span>
      <span class="ruby-ivar">@gem_sources</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">source</span>) <span class="ruby-operator">!=</span> <span class="ruby-identifier">source</span>

  <span class="ruby-ivar">@gem_sources</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">source</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
      <section id="Gem+Dependencies+DSL" class="documentation-section">
      <header class="documentation-section-title">
      <h2>
        Gem Dependencies DSL
      </h2>
      <span class="section-click-top">
        <a href="#top">&uarr; top</a>
      </span>
      </header>





                <section id="public-instance-Gem+Dependencies+DSL-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-gem" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          gem(name)
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          gem(name, *requirements)
                              </span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          gem(name, *requirements, options)
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Specifies a gem dependency with the given <code>name</code> and <code>requirements</code>.  You may also supply <code>options</code> following the <code>requirements</code></p>

<p><code>options</code> include:</p>
<dl class="rdoc-list note-list"><dt>require: 
<dd>
<p>RubyGems does not provide any autorequire features so requires in a gem dependencies file are recorded but ignored.</p>

<p>In bundler the require: option overrides the file to require during Bundler.require.  By default the name of the dependency is required in Bundler.  A single file or an Array of files may be given.</p>

<p>To disable requiring any file give <code>false</code>:</p>

<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;rake&#39;</span>, <span class="ruby-value">require:</span> <span class="ruby-keyword">false</span>
</pre>
</dd><dt>group: 
<dd>
<p>Place the dependencies in the given dependency group.  A single group or an Array of groups may be given.</p>

<p>See also <a href="GemDependencyAPI.html#method-i-group"><code>group</code></a></p>
</dd><dt>platform: 
<dd>
<p>Only install the dependency on the given platform.  A single platform or an Array of platforms may be given.</p>

<p>See <a href="GemDependencyAPI.html#method-i-platform"><code>platform</code></a> for a list of platforms available.</p>
</dd><dt>path: 
<dd>
<p>Install this dependency from an unpacked gem in the given directory.</p>

<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;modified_gem&#39;</span>, <span class="ruby-value">path:</span> <span class="ruby-string">&#39;vendor/modified_gem&#39;</span>
</pre>
</dd><dt>git: 
<dd>
<p>Install this dependency from a git repository:</p>

<pre>gem &#39;private_gem&#39;, git: git@my.company.example:private_gem.git&#39;</pre>
</dd><dt>gist: 
<dd>
<p>Install this dependency from the gist ID:</p>

<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;bang&#39;</span>, <span class="ruby-value">gist:</span> <span class="ruby-string">&#39;1232884&#39;</span>
</pre>
</dd><dt>github: 
<dd>
<p>Install this dependency from a github git repository:</p>

<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;private_gem&#39;</span>, <span class="ruby-value">github:</span> <span class="ruby-string">&#39;my_company/private_gem&#39;</span>
</pre>
</dd><dt>submodules: 
<dd>
<p>Set to <code>true</code> to include submodules when fetching the git repository for git:, gist: and github: dependencies.</p>
</dd><dt>ref: 
<dd>
<p>Use the given commit name or SHA for git:, gist: and github: dependencies.</p>
</dd><dt>branch: 
<dd>
<p>Use the given branch for git:, gist: and github: dependencies.</p>
</dd><dt>tag: 
<dd>
<p>Use the given tag for git:, gist: and github: dependencies.</p>
</dd></dl>

                              <div class="method-source-code" id="gem-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 359</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">requirements</span>)
    <span class="ruby-identifier">options</span> = <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">pop</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
    <span class="ruby-identifier">options</span> <span class="ruby-operator">||=</span> {}

    <span class="ruby-identifier">options</span>[<span class="ruby-value">:git</span>] = <span class="ruby-ivar">@current_repository</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@current_repository</span>

    <span class="ruby-identifier">source_set</span> = <span class="ruby-keyword">false</span>

    <span class="ruby-identifier">source_set</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">gem_path</span>       <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>
    <span class="ruby-identifier">source_set</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">gem_git</span>        <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>
    <span class="ruby-identifier">source_set</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">gem_git_source</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>
    <span class="ruby-identifier">source_set</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">gem_source</span>     <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>

    <span class="ruby-identifier">duplicate</span> = <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">name</span>

    <span class="ruby-ivar">@dependencies</span>[<span class="ruby-identifier">name</span>] =
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">source_set</span>
        <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">default</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">source_set</span>
        <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">source_set</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">create</span> <span class="ruby-identifier">requirements</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">gem_platforms</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>

    <span class="ruby-identifier">groups</span> = <span class="ruby-identifier">gem_group</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>

    <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> (<span class="ruby-identifier">groups</span> <span class="ruby-operator">&amp;</span> <span class="ruby-ivar">@without_groups</span>).<span class="ruby-identifier">empty?</span>

    <span class="ruby-identifier">pin_gem_source</span> <span class="ruby-identifier">name</span>, <span class="ruby-value">:default</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">source_set</span>

    <span class="ruby-identifier">gem_requires</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">duplicate</span>
      <span class="ruby-identifier">warn</span> <span class="ruby-identifier">&lt;&lt;-WARNING</span>
<span class="ruby-value">Gem dependencies file #{@path} requires #{name} more than once.
</span><span class="ruby-identifier">      WARNING</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-ivar">@set</span>.<span class="ruby-identifier">gem</span> <span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">requirements</span>
  <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gemspec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gemspec</span><span
                                class="method-args">(options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Loads dependencies from a gemspec file.</p>

<p><code>options</code> include:</p>
<dl class="rdoc-list note-list"><dt>name: 
<dd>
<p>The name portion of the gemspec file.  Defaults to searching for any gemspec file in the current directory.</p>

<pre class="ruby"><span class="ruby-identifier">gemspec</span> <span class="ruby-value">name:</span> <span class="ruby-string">&#39;my_gem&#39;</span>
</pre>
</dd><dt>path: 
<dd>
<p>The path the gemspec lives in.  Defaults to the current directory:</p>

<pre class="ruby"><span class="ruby-identifier">gemspec</span> <span class="ruby-string">&#39;my_gem&#39;</span>, <span class="ruby-value">path:</span> <span class="ruby-string">&#39;gemspecs&#39;</span>, <span class="ruby-value">name:</span> <span class="ruby-string">&#39;my_gem&#39;</span>
</pre>
</dd><dt>development_group: 
<dd>
<p>The group to add development dependencies to.  By default this is :development.  Only one group may be specified.</p>
</dd></dl>

                              <div class="method-source-code" id="gemspec-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 638</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gemspec</span>(<span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">name</span>              = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:name</span>) <span class="ruby-operator">||</span> <span class="ruby-string">&quot;{,*}&quot;</span>
  <span class="ruby-identifier">path</span>              = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:path</span>) <span class="ruby-operator">||</span> <span class="ruby-string">&quot;.&quot;</span>
  <span class="ruby-identifier">development_group</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:development_group</span>) <span class="ruby-operator">||</span> <span class="ruby-value">:development</span>

  <span class="ruby-identifier">spec</span> = <span class="ruby-identifier">find_gemspec</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">path</span>

  <span class="ruby-identifier">groups</span> = <span class="ruby-identifier">gem_group</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>, {}

  <span class="ruby-identifier">self_dep</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">version</span>

  <span class="ruby-identifier">add_dependencies</span> <span class="ruby-identifier">groups</span>, [<span class="ruby-identifier">self_dep</span>]
  <span class="ruby-identifier">add_dependencies</span> <span class="ruby-identifier">groups</span>, <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">runtime_dependencies</span>

  <span class="ruby-ivar">@dependencies</span>[<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">source_set</span>

  <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@dependencies</span>[<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">groups</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">development_group</span>

  <span class="ruby-identifier">add_dependencies</span> <span class="ruby-identifier">groups</span>, <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">development_dependencies</span>

  <span class="ruby-ivar">@vendor_set</span>.<span class="ruby-identifier">add_vendor_gem</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">path</span>
  <span class="ruby-identifier">gem_requires</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-git" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">git</span><span
                                class="method-args">(repository) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Block form for specifying gems from a git <code>repository</code>.</p>

<pre class="ruby"><span class="ruby-identifier">git</span> <span class="ruby-string">&#39;https://github.com/rails/rails.git&#39;</span> <span class="ruby-keyword">do</span>
  <span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;activesupport&#39;</span>
  <span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;activerecord&#39;</span>
<span class="ruby-keyword">end</span>
</pre>

                              <div class="method-source-code" id="git-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 592</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">git</span>(<span class="ruby-identifier">repository</span>)
  <span class="ruby-ivar">@current_repository</span> = <span class="ruby-identifier">repository</span>

  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@current_repository</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-group" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">group</span><span
                                class="method-args">(*groups) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Block form for placing a dependency in the given <code>groups</code>.</p>

<pre class="ruby"><span class="ruby-identifier">group</span> <span class="ruby-value">:development</span> <span class="ruby-keyword">do</span>
  <span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;debugger&#39;</span>
<span class="ruby-keyword">end</span>

<span class="ruby-identifier">group</span> <span class="ruby-value">:development</span>, <span class="ruby-value">:test</span> <span class="ruby-keyword">do</span>
  <span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;minitest&#39;</span>
<span class="ruby-keyword">end</span>
</pre>

<p>Groups can be excluded at install time using ‘gem install -g –without development`.  See `gem help install` and `gem help gem_dependencies` for further details.</p>

                              <div class="method-source-code" id="group-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 683</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">group</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">groups</span>)
  <span class="ruby-ivar">@current_groups</span> = <span class="ruby-identifier">groups</span>

  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@current_groups</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-platform" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">platform</span><span
                                class="method-args">(*platforms) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Block form for restricting gems to a set of platforms.</p>

<p>The gem dependencies platform is different from <a href="../Platform.html"><code>Gem::Platform</code></a>.  A platform gem.deps.rb platform matches on the ruby engine, the ruby version and whether or not windows is allowed.</p>
<dl class="rdoc-list note-list"><dt>:ruby, :ruby_XY 
<dd>
<p>Matches non-windows, non-jruby implementations where X and Y can be used to match releases in the 1.8, 1.9, 2.0 or 2.1 series.</p>
</dd><dt>:mri, :mri_XY 
<dd>
<p>Matches non-windows C Ruby (Matz Ruby) or only the 1.8, 1.9, 2.0 or 2.1 series.</p>
</dd><dt>:mingw, :mingw_XY 
<dd>
<p>Matches 32 bit C Ruby on MinGW or only the 1.8, 1.9, 2.0 or 2.1 series.</p>
</dd><dt>:x64_mingw, :x64_mingw_XY 
<dd>
<p>Matches 64 bit C Ruby on MinGW or only the 1.8, 1.9, 2.0 or 2.1 series.</p>
</dd><dt>:mswin, :mswin_XY 
<dd>
<p>Matches 32 bit C Ruby on Microsoft Windows or only the 1.8, 1.9, 2.0 or 2.1 series.</p>
</dd><dt>:mswin64, :mswin64_XY 
<dd>
<p>Matches 64 bit C Ruby on Microsoft Windows or only the 1.8, 1.9, 2.0 or 2.1 series.</p>
</dd><dt>:jruby, :jruby_XY 
<dd>
<p>Matches JRuby or JRuby in 1.8 or 1.9 mode.</p>
</dd><dt>:maglev 
<dd>
<p>Matches Maglev</p>
</dd><dt>:rbx 
<dd>
<p>Matches non-windows Rubinius</p>
</dd></dl>

<p>NOTE:  There is inconsistency in what environment a platform matches.  You may need to read the source to know the exact details.</p>

                              <div class="method-source-code" id="platform-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 757</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">platform</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">platforms</span>)
  <span class="ruby-ivar">@current_platforms</span> = <span class="ruby-identifier">platforms</span>

  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@current_platforms</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="GemDependencyAPI.html#method-i-platforms">platforms</a>
                            </div>

                          </div>

                  <div id="method-i-platforms" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">platforms</span><span
                                class="method-args">(*platforms)</span>
                            </div>

                            <div class="method-description">
                              <p>Block form for restricting gems to a particular set of platforms.  See <a href="GemDependencyAPI.html#method-i-platform"><code>platform</code></a>.</p>

                            </div>


                            <div class="aliases">
                              Alias for: <a href="GemDependencyAPI.html#method-i-platform">platform</a>
                            </div>
                          </div>

                  <div id="method-i-ruby" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ruby</span><span
                                class="method-args">(version, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Restricts this gem dependencies file to the given ruby <code>version</code>.</p>

<p>You may also provide <code>engine:</code> and <code>engine_version:</code> options to restrict this gem dependencies file to a particular ruby engine and its engine version.  This matching is performed by using the RUBY_ENGINE and RUBY_ENGINE_VERSION constants.</p>

                              <div class="method-source-code" id="ruby-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 783</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ruby</span>(<span class="ruby-identifier">version</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">engine</span>         = <span class="ruby-identifier">options</span>[<span class="ruby-value">:engine</span>]
  <span class="ruby-identifier">engine_version</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:engine_version</span>]

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
        <span class="ruby-string">&quot;You must specify engine_version along with the Ruby engine&quot;</span> <span class="ruby-keyword">if</span>
          <span class="ruby-identifier">engine</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">engine_version</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@installing</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-constant">RUBY_VERSION</span>
    <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Your Ruby version is #{RUBY_VERSION}, &quot;</span> \
              <span class="ruby-node">&quot;but your #{gem_deps_file} requires #{version}&quot;</span>

    <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyVersionMismatch</span>, <span class="ruby-identifier">message</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">engine</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">engine</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">ruby_engine</span>
    <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Your Ruby engine is #{Gem.ruby_engine}, &quot;</span> \
              <span class="ruby-node">&quot;but your #{gem_deps_file} requires #{engine}&quot;</span>

    <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyVersionMismatch</span>, <span class="ruby-identifier">message</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">engine_version</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">engine_version</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">RUBY_ENGINE_VERSION</span>
      <span class="ruby-identifier">message</span> =
        <span class="ruby-node">&quot;Your Ruby engine version is #{Gem.ruby_engine} #{RUBY_ENGINE_VERSION}, &quot;</span> \
        <span class="ruby-node">&quot;but your #{gem_deps_file} requires #{engine} #{engine_version}&quot;</span>

      <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyVersionMismatch</span>, <span class="ruby-identifier">message</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">source</span><span
                                class="method-args">(url)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets <code>url</code> as a source for gems for this dependency API.  RubyGems uses the default configured sources if no source was given.  If a source is set only that source is used.</p>

<p>This method differs in behavior from Bundler:</p>
<ul><li>
<p>The <code>:gemcutter</code>, # <code>:rubygems</code> and <code>:rubyforge</code> sources are not supported as they are deprecated in bundler.</p>
</li><li>
<p>The <code>prepend:</code> option is not supported.  If you wish to order sources then list them in your preferred order.</p>
</li></ul>

                              <div class="method-source-code" id="source-source">
            <pre><span class="ruby-comment"># File rubygems/request_set/gem_dependency_api.rb, line 834</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">source</span>(<span class="ruby-identifier">url</span>)
  <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">sources</span>.<span class="ruby-identifier">clear</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@default_sources</span>

  <span class="ruby-ivar">@default_sources</span> = <span class="ruby-keyword">false</span>

  <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">sources</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">url</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

